package com.sqx.modules.ruleClassify.controller;


import com.sqx.common.utils.Result;
import com.sqx.modules.ruleClassify.entity.RuleClassify;
import com.sqx.modules.ruleClassify.service.RuleClassifyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Api(value = "机械分类", tags = {"机械分类"})
@RequestMapping(value = "/app/rule/")
public class AppRuleController {
    @Autowired
    private RuleClassifyService ruleClassifyService;

    @ApiOperation("获取机械列表")
    @GetMapping("getClassifyList")
    public Result getClassifyList(RuleClassify classify) {
        return Result.success().put("data", ruleClassifyService.getClassifyList(classify));
    }

    @ApiOperation("用户获取机械")
    @GetMapping("userGetClassify")
    public Result userGetClassify(RuleClassify classify) {
        return Result.success().put("data", ruleClassifyService.userGetClassify(classify));
    }
    @ApiOperation("获取机械信息")
    @GetMapping("ruleClassifyId")
    public Result getClassify(Long ruleClassifyId){
        return Result.success().put("data",ruleClassifyService.getById(ruleClassifyId));
    }
}
